# -*- coding: utf-8 -*-
# @FileName : base_setting.py.py
# @Time     : 2023/6/8 19:16
# @Author   : Zhong Runke

SERVER_HOST = "0.0.0.0"
SERVER_PORT = 8888
SQLALCHEMY_ECHO = True

# 验证cookie名字
# AUTH_COOKIE_NAME = "Authorization"
AUTH_COOKIE_NAME = "chain_market"

# webase服务 云服务
WEBASE_URL = "http://172.26.188.139:5002/WeBASE-Front/trans/handle"
WEBASE_CONTRACTNAME = "YiBangBang"
WEBASE_CONTRACTADDRESS = "0xf425216308999fba32f1fb1a44697f0c82d607eb"
WEBASE_CONTRACTABI = '[{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_phone","type":"string"}],"name":"modifyPhone","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_desc","type":"string"},{"name":"_image","type":"string"},{"name":"_price","type":"uint256"},{"name":"_classifyId","type":"uint256"}],"name":"createGoods","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"}],"name":"cancelOrder","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_name","type":"string"},{"name":"_desc","type":"string"},{"name":"_image","type":"string"}],"name":"updateGoodsInfo","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_no","type":"string"},{"name":"_password","type":"string"}],"name":"login","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_no","type":"string"},{"name":"_name","type":"string"},{"name":"_password","type":"string"},{"name":"_email","type":"string"},{"name":"_phone","type":"string"}],"name":"register","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getUserInfo","outputs":[{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getGoodsInfo","outputs":[{"name":"","type":"uint256"},{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"createWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_oldPassword","type":"string"},{"name":"_newPassword","type":"string"}],"name":"modifyPwd","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_classifyId","type":"uint256"}],"name":"updateClassify","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"}],"name":"confirmReceipt","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"updateGoodsPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_number","type":"string"},{"name":"_orderId","type":"uint256"}],"name":"pay","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"}],"name":"logistics","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"users","outputs":[{"name":"no","type":"string"},{"name":"name","type":"string"},{"name":"password","type":"string"},{"name":"email","type":"string"},{"name":"phone","type":"string"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"rechargeWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_no","type":"string"}],"name":"modifySno","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_amount","type":"uint256"}],"name":"withdrawWallet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"removeGoods","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getWalletInfo","outputs":[{"name":"","type":"string"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_email","type":"string"}],"name":"modifyEmail","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_orderId","type":"uint256"}],"name":"getOrderInfo","outputs":[{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"string"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_orderId","type":"uint256"}],"name":"cancelOrderBackGoods","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"modifiyName","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_goodsNumber","type":"uint256"}],"name":"createOrder","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sellerAddress","type":"address"},{"indexed":true,"name":"buyerAddress","type":"address"},{"indexed":false,"name":"goodsNumber","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"}],"name":"NewOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sellerAddress","type":"address"},{"indexed":true,"name":"buyerAddress","type":"address"},{"indexed":false,"name":"number","type":"string"}],"name":"PayOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"sellerAddress","type":"address"},{"indexed":false,"name":"order_id","type":"uint256"},{"indexed":false,"name":"status","type":"uint256"}],"name":"logisticsLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyerAddress","type":"address"},{"indexed":false,"name":"order_id","type":"uint256"},{"indexed":false,"name":"status","type":"uint256"}],"name":"confirmReceiptLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyerAddress","type":"address"},{"indexed":false,"name":"order_id","type":"uint256"},{"indexed":false,"name":"status","type":"uint256"}],"name":"cancelOrderLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyerAddress","type":"address"},{"indexed":false,"name":"order_id","type":"uint256"},{"indexed":false,"name":"status","type":"uint256"}],"name":"cancelOrderBackGoodsLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"id","type":"uint256"},{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"price","type":"uint256"}],"name":"newGoods","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"id","type":"uint256"},{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"desc","type":"string"},{"indexed":false,"name":"image","type":"string"}],"name":"updateGoodsInfoLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"id","type":"uint256"},{"indexed":false,"name":"price","type":"uint256"}],"name":"updateGoodsPriceLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"id","type":"uint256"},{"indexed":false,"name":"classifyId","type":"uint256"}],"name":"updateClassifyLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"id","type":"uint256"}],"name":"removeGoodsLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"walletAddress","type":"address"},{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"timestamp","type":"uint256"}],"name":"WalletCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WalletTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"walletAddress","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WalletRecharge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"walletAddress","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"WalletWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"walletAddress","type":"address"},{"indexed":false,"name":"name","type":"string"}],"name":"WalletNameRevise","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"no","type":"string"},{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"email","type":"string"},{"indexed":false,"name":"phone","type":"string"}],"name":"NewUserRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"}],"name":"UserLoginLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"userAddress","type":"address"},{"indexed":false,"name":"_oldPassword","type":"string"},{"indexed":false,"name":"_newPassword","type":"string"}],"name":"ModifyPassWordLog","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"shipSetOwner","type":"event"}]'
WEBASE_DEPLOYADDRESS = "0xf342a5cead5ec5c3910bcd22a3b9971d9e8fc7d4"

WEIXIN_APP = {
    'appid': 'wx47b5911f64e0c8b1',
    'appkey': 'a86200ccfbfc64886ab427b812e2e6fb',
    'paykey':'',
    'mch_id':'1443337302',
    'callback_url': '/api/order/callback'
}

##过滤url
IGNORE_URLS = [
    "^/login",
    "^/register",
    "^/auth"
]

IGNORE_CHECK_LOGIN_URLS = [
    "^/static",
    "^/favicon.ico"
]

WEB_FILE_PATH = "https://wechat.taihua.site/data"

APP = {
    'domain':'https://wechat.taihua.site'
}

UPLOAD = {
    'ext':[ 'jpg','gif','bmp','jpeg','png' ],
    'prefix_path': '/web/static/upload/',
    'prefix_url': '/v/upload/'
}

PAY_STATUS_DISPLAY_MAPPING = {
    "0":"订单关闭",
    "1":"支付成功",
    "-8":"待支付",
    "-7":"待发货",
    "-6":"待确认",
    "-5":"待评价"
}
